package 强化训练;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class 最大平均战力 {
    public static void main(String[] args){
        ArrayList<Integer> list = new ArrayList();
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        while(sc.hasNext()){
            int b = sc.nextInt();
            list.add(b);
        }
        Integer[] nums = (Integer[]) list.toArray();
        int len = nums.length;
        int[] arr = new int[len];
        for(int i = 0 ;i < len ;i++){
            arr[i] = nums[i];
        }
        Arrays.sort(arr);
        int count = 0;
        int ret = 0;
        for(int i = len - 2;i >= 0;i = i-2){
            ret += arr[i];
            count++;
            if(count >= a) break;
        }
        System.out.println(ret);
    }
}
